package com.job.blossom.work0709;

/**
 * @author ZJM
 * @version 1.0
 * @since 2022-07-10 18:02:10
 *
 * 先寻求规律，然后行列分析，循环打印
 */
public class PrintTriangle {
    public static void main(String[] args) {
        int triangle[][] = new int[10][];

        for (int i = 0; i <triangle.length ; i++) {
            triangle[i] = new int[i+1];

            for (int j = 0; j <=i ; j++) {

                if(i==0||j==0||j==i){
                    triangle[i][j]=1;
                }else{
                    triangle[i][j] = triangle[i-1][j] + triangle[i-1][j-1];
                }
                System.out.print(triangle[i][j]+"\t");
            }
            System.out.println();
        }
    }
}
